//
//  BSAddBtn.m
//  BaiSiBuDeJie
//
//  Created by 王位 on 8/22/16.
//  Copyright © 2016 tsaievan. All rights reserved.
//

#import "BSAddBtn.h"

#import "UIView+HM.h"

@implementation BSAddBtn

-(void)layoutSubviews
{
    
    [super layoutSubviews];
    
    [self setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 30,0)];
    
    self.titleLabel.w = self.imageView.frame.size.width;
    
    self.titleLabel.y = self.imageView.h + 10;
    
    self.titleLabel.h = 20;
    
    self.titleLabel.x = 0;
    
    self.titleLabel.font = [UIFont systemFontOfSize:15];
    
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    
}


+(instancetype)BSAddBtnWithIcon:(NSString *)icon WithName:(NSString*)name
{
    UIImage * image = [UIImage imageNamed:icon];
    
    BSAddBtn * btn = [[BSAddBtn alloc]init];
    
    [btn setImage:image forState:UIControlStateNormal];
    
    [btn setTitle:name forState:UIControlStateNormal];
 
    
    [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    return btn;
}


@end
